import PopupMenu from "./PopupMenu";
import BitmapText from "../BitmapText";
import GameConst from "../GameConst";
import ButtonObject from "../ButtonObject";
import AnimatedNode from "../amn/AnimatedNode";
import ClickableObject from "../ClickableObject";
import SoundButton from "../SoundsButton";
import SoundsManager from "../soundmanager";

export default class PauseMenu extends PopupMenu {
    constructor() {
        super('pause_panel');
        // var t = this;
        // var n = this.sprite;
        // var r;
        // var textUI = new BitmapText("暂停", GameConst.BITMAPFONT_BLUE);
        // textUI.letterSpacing = -10;
        // textUI.x = GameConst.SCREEN_W / 2 - textUI.getBounds().width / 2;
        // textUI.y = -40;
        // this.baseSprite.addChild(textUI);
        // var s = new ButtonObject(6, function (e) {
        //     t.loadMainMenu(e);
        // }, this.baseSprite, 350 + 35, 115 - 10);
        // this.animatedButtons.push(s);
        // this.clickables.push(s);
        // var s = new ButtonObject(5, function (e) {
        //     t.restartLevel(e);
        // }, this.baseSprite, 210 + 35, 115 - 10);
        // this.animatedButtons.push(s);
        // this.clickables.push(s);
        // var s = new SoundButton(2, this.baseSprite, 570, 115 - 50);
        // this.animatedButtons.push(s);
        // this.clickables.push(s);
        // var s = new SoundButton(0, this.baseSprite, 570, 215 - 50);
        // this.animatedButtons.push(s);
        // this.clickables.push(s);
        // this.targetPos = 290;
        // this.button = new AnimatedNode(GameConst.animationManager.getAnimation("button"), 1 / 30, null);
        // this.baseSprite.addChild(this.button);
        // this.button.addAction(97, 0, 0);
        // this.button.addAction(106, 0, -1);
        // this.button.x = GameConst.SCREEN_W / 2 - 85;
        // this.button.y = 210 - 40;
        // this.button.scaleX = this.button.scaleY = .75;
        // this.button.addAction(this.button.totalFrames - 1, 1, 0);
        // var o = new ClickableObject(this.button);
        // o.setCircle(120 * this.button.scaleX, 120 * this.button.scaleX, 120 * this.button.scaleX);
        // o.callback = function () {
        //     t.onPlayDown();
        // };
        // this.clickables.push(o);

        // var sp = new SoundButton(false,'menu/btn_sounds_');
        // new SoundButton(true,'menu/btn_music_');
    }


    restartLevel(){
        GameConst.level.onRestart();
        super.restartLevel();
    }

}
